package com.be.beadmin.product.entity;

import com.be.beadmin.common.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * @Description: 单柜工序生产信息
 * @author: Jiaming Zheng
 * @Date: Create in 15:48 2023/3/19
 * @Modified By:
 **/

@Entity
@Table(name="T_OM_ProductManufactInfor")
@Getter
@Setter
public class ProductManufactInfor extends BaseEntity {

    @Column(name = "BatchProductId",columnDefinition = "VARCHAR(50) COMMENT '柜体ID' null")
    private String batchProductId;

    @Column(name = "IsProductionProcess",columnDefinition = "int COMMENT '是否属于生产工序(0/1)'")
    private Integer isProductionProcess;
    
    @Column(name = "ProductType",columnDefinition = "VARCHAR(50) COMMENT '柜体类型'")
    private String ProductType;

    @Column(name = "BatchProductCode",columnDefinition = "VARCHAR(50) COMMENT '柜体编号'")
    private String batchProductCode;

    @Column(name = "WorkOrderInforCode",columnDefinition = "VARCHAR(50) COMMENT '工单编号'")
    private String workOrderInforCode;

    @Column(name = "ProcessId",columnDefinition = "VARCHAR(50) COMMENT '工序ID'")
    private String processId;

    @Column(name = "ProcessName",columnDefinition = "VARCHAR(50) COMMENT '工序名称'")
    private String processName;

    @Column(name = "ProcessCode",columnDefinition = "VARCHAR(50) COMMENT '工序编码'")
    private String processCode;

    @Column(name = "StandManufactWorkhour",columnDefinition = "Float COMMENT '加工工序标准生产工时'")
    private Float standManufactWorkhour ;

    @Column(name = "ManufactWorkhour",columnDefinition = "Float COMMENT '加工工序实际生产工时'")
    private Float ManufactWorkhour ;

    @Column(name = "PlanManufactStartDate",columnDefinition = "datetime COMMENT '工序计划开始时间' ")
    private Date planManufactStartDate;

    @Column(name = "PlanManufactEndDate",columnDefinition = "datetime COMMENT '工序计划完成时间' ")
    private Date planManufactEndDate;

    @Column(name = "ManufactStartDate",columnDefinition = "datetime COMMENT '工序实际开始时间' ")
    private Date manufactStartDate;

    @Column(name = "ManufactEndDate",columnDefinition = "datetime COMMENT '工序实际完成时间' ")
    private Date manufactEndDate;

    @Column(name = "Sequence",columnDefinition = "int COMMENT '工序序列'  not null")
    private Integer sequence;

    /**
     * 0待执行
     * 1执行中
     * 2暂停
     * 3完成
     */
    @Column(
            name = "ProcessStatus",
            nullable = false,
            columnDefinition = "decimal(1) default 0 COMMENT '当前工序执行状态' "
    )
    protected Integer processStatus = 0;
    /**
     * 0 待执行
     * 1 执行中
     * 2 暂停
     * 3 完成
     * 4 未按计划开始
     * 5 未按计划结束
     */
    @Column(
            name = "AlertStatus",
            nullable = false,
            columnDefinition = "int default 0 COMMENT '当前工序预警状态' "
    )
    protected Integer alertStatus = 0;
    /**
     * 0无异常
     * 1有异常
     */
    @Column(
            name = "ProcessErrorFlag",
            nullable = false,
            columnDefinition = "decimal(1) default 0 COMMENT '当前工序执行异常标识' "
    )
    protected Integer processErrorFlag = 0;

    @Column(name = "Memo", columnDefinition = "VARCHAR(50) COMMENT '备注' ")
    private String memo;

    @Column(name = "StandCycle",columnDefinition = "int COMMENT '标准周期(day)' ")
    private int standCycle;

    @Column(name = "IsSchduling",columnDefinition = "tinyint COMMENT '正在排程吗' ")
    private int isSchduling;

    @Column(name = "ProjectCode",columnDefinition = "VARCHAR(50) COMMENT '项目Code'")
    private String projectCode;

    @Column(name = "ProjectName",columnDefinition = "VARCHAR(50) COMMENT '项目name'")
    private String projectName;
    @Override
    public String toString() {
        return "ProductManufactInfor{" +
                "batchProductId='" + batchProductId + '\'' +
                ", batchProductCode='" + batchProductCode + '\'' +
                ", processId='" + processId + '\'' +
                ", processName='" + processName + '\'' +
                ", processCode='" + processCode + '\'' +
                ", standManufactWorkhour=" + standManufactWorkhour +
                ", planManufactStartDate=" + planManufactStartDate +
                ", planManufactEndDate=" + planManufactEndDate +
                ", manufactStartDate=" + manufactStartDate +
                ", manufactEndDate=" + manufactEndDate +
                ", sequence=" + sequence +
                ", processStatus=" + processStatus +
                ", processErrorFlag=" + processErrorFlag +
                ", memo='" + memo + '\'' +
                '}';
    }
}
